/*
 * @Author: zxc
 * @Date: 2020-11-15 09:09:08
 * @LastEditTime: 2020-11-15 09:29:43
 * @LastEditors: zxc
 * @Description:模板方法模式
 */

/**
 * @Author: zxc
 * @Date: 2020-11-15 09:09:36
 * @func coofie-or-tea
 */
// class Coofie {
//   static boilWater() {
//     console.log("煮水")
//   }
//   static brewCoffeeGriends() {
//     console.log("水冲咖啡")
//   }
//   static pourInCup() {
//     console.log("倒咖啡")
//   }
//   static addSugarAndMilk() {
//     console.log("注入灵魂")
//   }
//   init() {
//     Coofie.boilWater()
//     Coofie.brewCoffeeGriends()
//     Coofie.pourInCup()
//     Coofie.addSugarAndMilk()
//   }
// }

// let coofie = new Coofie()
// coofie.init()

class Modal {
  boilWater() {
    console.log("煮水")
  }
  brewCoffeeGriends() {}
  pourInCup() {}
  addSugarAndMilk() {}
  init() {
    this.boilWater()
    this.brewCoffeeGriends()
    this.pourInCup()
    this.addSugarAndMilk()
  }
}
class Coofie extends Modal {
  constructor() {
    super()
  }
  brewCoffeeGriends() {
    console.log("水冲咖啡")
  }
  pourInCup() {
    console.log("倒咖啡")
  }
  addSugarAndMilk() {
    console.log("注入灵魂")
  }
}

let coofie = new Coofie()
coofie.init()
//TODO 抽象类实现在ts文件中的同名文件里
